<template>
  <div>
    <!-- 引导页 -->
    <van-swipe class="my-swipe" :show-indicators="false">
      <van-swipe-item><img src="@/assets/img/person/guide/guide01.png" /></van-swipe-item>
      <van-swipe-item><img src="@/assets/img/person/guide/guide02.png" /></van-swipe-item>
      <van-swipe-item><img src="@/assets/img/person/guide/guide03.png" /></van-swipe-item>
    </van-swipe>

    <!-- 身份选择 -->
    <div class="my-identity">
      <van-button type="primary" color="#07f" text="我要招人" @click="next('C')"></van-button>
      <van-button type="primary" color="#f70" text="我要求职" @click="next('P')"></van-button>
    </div>
  </div>
</template>

<script>
import { AddVersion, GetAPPUserType, switchUserType } from "@/util/session";
import { Swipe, SwipeItem, Button } from "vant";
export default {
  name: "LunchPage",
  components: {
    [Swipe.name]: Swipe,
    [SwipeItem.name]: SwipeItem,
    [Button.name]: Button,
  },
  // 定义属性
  data() {
    return {};
  },
  // 方法集合
  methods: {
    next(usertype) {
      switchUserType(usertype);
      if (usertype === "P") {
        this.$router.push("person-main");
      } else {
        this.$router.push("company-login");
      }
      // AddVersion();
      // let app_type = GetAPPUserType();
      // if (app_type === "P") {
      //   this.$router.replace("person-main");
      // } else if (app_type === "C") {
      //   this.$router.replace("company-login");
      // } else {
      //   this.$router.replace("version-choice");
      // }
    },
  },
};
</script>

<style scoped>
.my-swipe {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fbfbfb;
}

.my-swipe .van-swipe-item img {
  width: 100%;
}

.my-identity {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  padding: 0 25px 25px;
}

.my-identity button {
  display: flex;
  justify-content: center;
  flex: 1;
  padding: 0;
  border-radius: 5px;
  font-size: 18px;
}

.my-identity button + button {
  margin-left: 16px;
}
</style>
